{% extends 'layout.html' %}

{% block content %}
    <div class="container">


        <div style="margin-bottom: 10px">
            <a class="btn btn-success" href="/city/add/">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新建
            </a>
        </div>

        <div class="panel panel-default">
            <!-- 面板标题 -->
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                城市列表
            </div>

            <!-- 面板表格部分 -->
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>LOGO</th>
                    <th>城市名称</th>
                    <th>人口</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for obj in queryset %}
                    <tr>
                        <th scope="row">{{ obj.id }}</th>
                        <td>
                            <img src="/media/{{ obj.img }}" style="height: 80px;width: 80px">
                        </td>

                        <td>{{ obj.name }}</td>
                        <td>{{ obj.count }}</td>
                        <td>
                            <a class="btn btn-primary btn-xs" href="#">编辑</a>
                            <a class="btn btn-danger btn-xs" href="#">删除</a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>


{% endblock %}